
<!-- 模态框HTML -->
<form class="ajax-form" method="post" data-role="eject"
      action="{:addons_url('GiveReward://GiveReward/doGiveReward',array('param'=>http_build_query($param)))}">
<input type="hidden" name="type" value="{$param.type}">
    <input type="hidden" name="url" value="{$param.url}">
    <input type="hidden" name="user_id" value="{$param.user_id}">
    <style>
        .modal-dialog {
            width: 325px;

        }

        .modal-body {
            min-height: 200px;
        }
    </style>
    <if condition="!is_login()">
        <div class="need_login_tip">请登录后打赏</div>
    </if>

    <if condition="$myGive eq 0">

        <div style="padding-bottom:20px" class="clearfix">
            <span class="col-md-4 pad0" style="font-size: 14px;height: 32px;padding-top: 2px">打赏类型：</span>
    <span class="col-md-8 pad0">
        <select data-role="select" name="field" class="chosen-select form-control" tabindex="-1" style="width: 94%">
            <volist name="field" id="vl">
                <option value="{$vl.id}">{$vl.title}</option>
            </volist>
        </select></span>
        </div>
        <div style="padding-bottom:45px">
            <span class="col-md-4 pad0" style="font-size: 14px;height: 32px;padding-top: 2px">打赏数额：</span>
    <span class="col-md-8 pad0">
        <input type="text" name="num" placeholder="请输入数额" value="{$rand}" style="width: 94%;line-height: 23px" onKeyPress="if((event.keyCode<48 || event.keyCode>57) && event.keyCode!=46 || /\.\d\d$/.test(value))event.returnValue=false">
    </span>
        </div>
        <div class="col-md-6" style="text-align: center">
    <span>

            <input type="submit" data-role="submitreport" value="{:L('_OK_')}" class="btn btn-primary send_box" <if
            condition="(!is_login())||($myGive neq 0)">disabled="disabled"
    </if>>
    </span>
        </div>
        <div class="col-md-6" style="text-align: center">
        <span>
            <input type="button" value="{:L('_CANCEL_')}" class="btn btn-primary send_box" data-role="cancel"
                   data-dismiss="modal">
    </span>
        </div>
        <else/>
        <div class="col-md-12" style="text-align: center">
            <H2 >您已经打赏过了！</h2>

            <h3 style="color: #FF3300">您打赏过{$myGive.num}{$myGive.field.unit}{$myGive.field.title}</h3>
        </div>


    </if>


    <div class="col-md-12" style="text-align: center;margin-top: 20px">
        <span><a style="color: #3FB8A9" href="javascript:void 0" onclick="record($(this))">查看打赏记录</a></span>
    </div>
    <div class="ulclass col-md-12 " >

    </div>
    <div class="clearfix">

    </div>
</form>
<script>
    $(document).ready(function () {
        $('[data-role="submitreport"]').click(function () {
            $('[data-dismiss="modal"]').click();
        });
    });
    var page = 1;
    function record() {
        var url_id = "{$param['url']}";
        var type = "{$param['type']}";
        var url = "{:addons_url('GiveReward://GiveReward/getRecord')}";

        $.post(url, {url_id: url_id, type: type, page: page}, function (msg) {
            if (msg.status) {
                $(".ulclass").append(msg.html);
                page++;
            } else {
                toast.error(msg.info);
            }
        }, 'json')
    }
</script>



